//
//  PersonalCenterCell.m
//  NewPro
//
//  Created by RYX on 2018/10/11.
//  Copyright © 2018年 何荧红. All rights reserved.
//

#import "PersonalCenterCell.h"

@implementation PersonalCenterCell

+ (instancetype)tempWithTableView:(UITableView *)tableView andTitlesArr:(NSArray *)titlesArr andIndexPath:(NSIndexPath *)indexPath{
    
    NSString *identity = @"";
    NSInteger index = 0;
    switch (indexPath.row) {
        case 0:
            identity = @"CELL1";
            index = 0;
            break;
            
        default:
            identity = @"CELL2";
            index = 1;
            break;
    }
    
    PersonalCenterCell *cell = [tableView dequeueReusableCellWithIdentifier:identity];
    if (!cell) {
        
        ClassName
        cell = [[[NSBundle mainBundle] loadNibNamed:className owner:self options:nil] objectAtIndex:index];
    }
    return cell;
}

+ (CGFloat)getHeightWithIndexPath:(NSIndexPath *)indexPath{
    
    UITableViewCell *cell = [self cellWithIndexPath:indexPath];
    return cell.frame.size.height;
}

+ (instancetype)cellWithIndexPath:(NSIndexPath *)indexPath{
    
    ClassName
    NSInteger index = 0;
    switch (indexPath.row) {
        case 0:
            index = 0;
            break;
            
        default:
            index = 1;
            break;
    }
    
    return [[[NSBundle mainBundle] loadNibNamed:className owner:self options:nil] objectAtIndex:index];
}

- (void)setTitleWithArr:(NSArray *)titilesArr andDesArr:(NSArray *)desArr{
    
    if (self.rowOfCell == 0) {
        
        self.cell1_titleLa.text =  titilesArr[self.rowOfCell];
//        self.cell1_headerIm.image = desArr[self.rowOfCell];
        
        [self.cell1_headerIm sd_setImageWithURL:[NSURL URLWithString:desArr[self.rowOfCell]] placeholderImage:[UIImage imageNamed:@"headePlase"]];
        
    }else{
        
        self.cell2_titleLa.text = titilesArr[self.rowOfCell];
        self.cell2_desLa.text = desArr[self.rowOfCell];
    }
}


- (void)awakeFromNib {
    [super awakeFromNib];

    self.cell1_headerIm.contentMode =  UIViewContentModeScaleAspectFill;
    
    self.cell1_headerIm.clipsToBounds  = YES;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
